﻿{include file="public/header" /}
<title>用户管理</title>
</head>

<body>
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 短信模板
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="page-container">
		<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
		<a href="javascript:;" onclick="add('添加','{:url('add')}','410','410')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe600;</i> 添加模板</a> 
		<a href="{:url('fas')}"  class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 发送注册短信</a></span> </div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th class="text-center">应用场景</th>
						<th class="text-center">短信签名</th>
						<th class="text-center">模板ID</th>
						<th class="text-center">模板参数</th>
						<th class="text-center">更新时间</th>
						<th class="text-center">oem_id</th>
						<th class="text-center">操作</th>
					</tr>
				</thead>
				<tbody>
					{foreach name="list" item="vo"}
					<tr class="text-c">
						<td>
							{$vo.title}
						</td>
						<td class="text-center">{$vo.sign_name}</td>
						<td class="text-center">{$vo.tid}</td>
						<td class="text-center">{$vo.params}</td>
						<td class="text-center">{$vo.update_time}</td>
						<td class="text-center">{$vo.oem_id}</td>
						<td class="text-center">
							<a href="javascript:;" onclick="update('修改模板','{:url('update',['id'=>$vo.id])}','410','380')" class="btn btn-primary btn-outline btn-xs">
								<i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
							<a href="javascript:;" onclick="sms_del(this,{$vo.id})" class="btn btn-danger btn-outline btn-xs">
								<i class="fa fa-trash-o"></i> 删除</a>
						</td>
					</tr>
					{/foreach}
				</tbody>
			</table>

		</div>
		<style>
		.pagination li{float: left;}
		</style>
		<div id="pageNav" class="pageNav">{$list->render()}</div>
	</div>
	{include file="public/footer" /}
	<script type="text/javascript">
		/*用户-添加*/
		function add(title, url, w, h) {
			layer_show(title, url, w, h);
		}

		/*用户-编辑*/
		function update(title, url, w, h) {
			layer_show(title, url, w, h);
		}

		/*管理员-删除*/
		function sms_del(obj, id) {
				layer.confirm('确认要删除吗？', {
					btn: ['确定', '取消'] //按钮
				}, function() {
					$.ajax({
						type: 'get',
						url: "{:url('SmsTemplate/sms_del')}",
						dataType: 'json',
						data: {
							id: id
						},
						success: function(data) {
							$(obj).parents("tr").remove();
							layer.msg('已删除!', {
								icon: 1,
								time: 1000
							});
						},
						error: function(data) {
							console.log(data.msg);
						}
					});
				});
			}
	</script>
